

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Creating an LLVM Project &mdash; LLVM 3.2 documentation</title>
    
    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '3.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="LLVM 3.2 documentation" href="index.html" />
    <link rel="up" title="Development Process Documentation" href="development_process.html" />
    <link rel="next" title="Mailing Lists" href="mailing_lists.html" />
    <link rel="prev" title="LLVM Makefile Guide" href="MakefileGuide.html" />
<style type="text/css">
  table.right { float: right; margin-left: 20px; }
  table.right td { border: 1px solid #ccc; }
</style>

  </head>
  <body>
<div class="logo">
  <a href="index.html">
    <img src="_static/logo.png"
         alt="LLVM Logo" width="250" height="88"/></a>
</div>

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="mailing_lists.html" title="Mailing Lists"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="MakefileGuide.html" title="LLVM Makefile Guide"
             accesskey="P">previous</a> |</li>
  <li><a href="http://llvm.org/">LLVM Home</a>&nbsp;|&nbsp;</li>
  <li><a href="index.html">Documentation</a>&raquo;</li>

          <li><a href="development_process.html" accesskey="U">Development Process Documentation</a> &raquo;</li> 
      </ul>
    </div>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Creating an LLVM Project</a><ul>
<li><a class="reference internal" href="#overview">Overview</a></li>
<li><a class="reference internal" href="#create-a-project-from-the-sample-project">Create a Project from the Sample Project</a></li>
<li><a class="reference internal" href="#source-tree-layout">Source Tree Layout</a></li>
<li><a class="reference internal" href="#writing-llvm-style-makefiles">Writing LLVM Style Makefiles</a><ul>
<li><a class="reference internal" href="#required-variables">Required Variables</a></li>
<li><a class="reference internal" href="#variables-for-building-subdirectories">Variables for Building Subdirectories</a></li>
<li><a class="reference internal" href="#variables-for-building-libraries">Variables for Building Libraries</a></li>
<li><a class="reference internal" href="#variables-for-building-programs">Variables for Building Programs</a></li>
<li><a class="reference internal" href="#miscellaneous-variables">Miscellaneous Variables</a></li>
</ul>
</li>
<li><a class="reference internal" href="#placement-of-object-code">Placement of Object Code</a></li>
<li><a class="reference internal" href="#further-help">Further Help</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="MakefileGuide.html"
                        title="previous chapter">LLVM Makefile Guide</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="mailing_lists.html"
                        title="next chapter">Mailing Lists</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/Projects.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="creating-an-llvm-project">
<span id="projects"></span><h1>Creating an LLVM Project<a class="headerlink" href="#creating-an-llvm-project" title="Permalink to this headline">¶</a></h1>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#overview" id="id1">Overview</a></li>
<li><a class="reference internal" href="#create-a-project-from-the-sample-project" id="id2">Create a Project from the Sample Project</a></li>
<li><a class="reference internal" href="#source-tree-layout" id="id3">Source Tree Layout</a></li>
<li><a class="reference internal" href="#writing-llvm-style-makefiles" id="id4">Writing LLVM Style Makefiles</a><ul>
<li><a class="reference internal" href="#required-variables" id="id5">Required Variables</a></li>
<li><a class="reference internal" href="#variables-for-building-subdirectories" id="id6">Variables for Building Subdirectories</a></li>
<li><a class="reference internal" href="#variables-for-building-libraries" id="id7">Variables for Building Libraries</a></li>
<li><a class="reference internal" href="#variables-for-building-programs" id="id8">Variables for Building Programs</a></li>
<li><a class="reference internal" href="#miscellaneous-variables" id="id9">Miscellaneous Variables</a></li>
</ul>
</li>
<li><a class="reference internal" href="#placement-of-object-code" id="id10">Placement of Object Code</a></li>
<li><a class="reference internal" href="#further-help" id="id11">Further Help</a></li>
</ul>
</div>
<div class="section" id="overview">
<h2><a class="toc-backref" href="#id1">Overview</a><a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2>
<p>The LLVM build system is designed to facilitate the building of third party
projects that use LLVM header files, libraries, and tools.  In order to use
these facilities, a <tt class="docutils literal"><span class="pre">Makefile</span></tt> from a project must do the following things:</p>
<ul class="simple">
<li>Set <tt class="docutils literal"><span class="pre">make</span></tt> variables. There are several variables that a <tt class="docutils literal"><span class="pre">Makefile</span></tt> needs
to set to use the LLVM build system:<ul>
<li><tt class="docutils literal"><span class="pre">PROJECT_NAME</span></tt> - The name by which your project is known.</li>
<li><tt class="docutils literal"><span class="pre">LLVM_SRC_ROOT</span></tt> - The root of the LLVM source tree.</li>
<li><tt class="docutils literal"><span class="pre">LLVM_OBJ_ROOT</span></tt> - The root of the LLVM object tree.</li>
<li><tt class="docutils literal"><span class="pre">PROJ_SRC_ROOT</span></tt> - The root of the project&#8217;s source tree.</li>
<li><tt class="docutils literal"><span class="pre">PROJ_OBJ_ROOT</span></tt> - The root of the project&#8217;s object tree.</li>
<li><tt class="docutils literal"><span class="pre">PROJ_INSTALL_ROOT</span></tt> - The root installation directory.</li>
<li><tt class="docutils literal"><span class="pre">LEVEL</span></tt> - The relative path from the current directory to the
project&#8217;s root <tt class="docutils literal"><span class="pre">($PROJ_OBJ_ROOT)</span></tt>.</li>
</ul>
</li>
<li>Include <tt class="docutils literal"><span class="pre">Makefile.config</span></tt> from <tt class="docutils literal"><span class="pre">$(LLVM_OBJ_ROOT)</span></tt>.</li>
<li>Include <tt class="docutils literal"><span class="pre">Makefile.rules</span></tt> from <tt class="docutils literal"><span class="pre">$(LLVM_SRC_ROOT)</span></tt>.</li>
</ul>
<p>There are two ways that you can set all of these variables:</p>
<ul class="simple">
<li>You can write your own <tt class="docutils literal"><span class="pre">Makefiles</span></tt> which hard-code these values.</li>
<li>You can use the pre-made LLVM sample project. This sample project includes
<tt class="docutils literal"><span class="pre">Makefiles</span></tt>, a configure script that can be used to configure the location
of LLVM, and the ability to support multiple object directories from a single
source directory.</li>
</ul>
<p>This document assumes that you will base your project on the LLVM sample project
found in <tt class="docutils literal"><span class="pre">llvm/projects/sample</span></tt>. If you want to devise your own build system,
studying the sample project and LLVM <tt class="docutils literal"><span class="pre">Makefiles</span></tt> will probably provide enough
information on how to write your own <tt class="docutils literal"><span class="pre">Makefiles</span></tt>.</p>
</div>
<div class="section" id="create-a-project-from-the-sample-project">
<h2><a class="toc-backref" href="#id2">Create a Project from the Sample Project</a><a class="headerlink" href="#create-a-project-from-the-sample-project" title="Permalink to this headline">¶</a></h2>
<p>Follow these simple steps to start your project:</p>
<ol class="arabic">
<li><p class="first">Copy the <tt class="docutils literal"><span class="pre">llvm/projects/sample</span></tt> directory to any place of your choosing.
You can place it anywhere you like. Rename the directory to match the name
of your project.</p>
</li>
<li><p class="first">If you downloaded LLVM using Subversion, remove all the directories named
<tt class="docutils literal"><span class="pre">.svn</span></tt> (and all the files therein) from your project&#8217;s new source tree.
This will keep Subversion from thinking that your project is inside
<tt class="docutils literal"><span class="pre">llvm/trunk/projects/sample</span></tt>.</p>
</li>
<li><p class="first">Add your source code and Makefiles to your source tree.</p>
</li>
<li><p class="first">If you want your project to be configured with the <tt class="docutils literal"><span class="pre">configure</span></tt> script then
you need to edit <tt class="docutils literal"><span class="pre">autoconf/configure.ac</span></tt> as follows:</p>
<ul class="simple">
<li><strong>AC_INIT</strong> - Place the name of your project, its version number and a
contact email address for your project as the arguments to this macro</li>
<li><strong>AC_CONFIG_AUX_DIR</strong> - If your project isn&#8217;t in the <tt class="docutils literal"><span class="pre">llvm/projects</span></tt>
directory then you might need to adjust this so that it specifies a
relative path to the <tt class="docutils literal"><span class="pre">llvm/autoconf</span></tt> directory.</li>
<li><strong>LLVM_CONFIG_PROJECT</strong> - Just leave this alone.</li>
<li><strong>AC_CONFIG_SRCDIR</strong> - Specify a path to a file name that identifies your
project; or just leave it at <tt class="docutils literal"><span class="pre">Makefile.common.in</span></tt>.</li>
<li><strong>AC_CONFIG_FILES</strong> - Do not change.</li>
<li><strong>AC_CONFIG_MAKEFILE</strong> - Use one of these macros for each Makefile that
your project uses. This macro arranges for your makefiles to be copied from
the source directory, unmodified, to the build directory.</li>
</ul>
</li>
<li><p class="first">After updating <tt class="docutils literal"><span class="pre">autoconf/configure.ac</span></tt>, regenerate the configure script
with these commands. (You must be using <tt class="docutils literal"><span class="pre">Autoconf</span></tt> version 2.59 or later
and your <tt class="docutils literal"><span class="pre">aclocal</span></tt> version should be 1.9 or later.)</p>
<blockquote>
<div><div class="highlight-bash"><div class="highlight"><pre>% <span class="nb">cd </span>autoconf
% ./AutoRegen.sh
</pre></div>
</div>
</div></blockquote>
</li>
<li><p class="first">Run <tt class="docutils literal"><span class="pre">configure</span></tt> in the directory in which you want to place object code.
Use the following options to tell your project where it can find LLVM:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">--with-llvmsrc=&lt;directory&gt;</span></tt></dt>
<dd><p class="first last">Tell your project where the LLVM source tree is located.</p>
</dd>
<dt><tt class="docutils literal"><span class="pre">--with-llvmobj=&lt;directory&gt;</span></tt></dt>
<dd><p class="first last">Tell your project where the LLVM object tree is located.</p>
</dd>
<dt><tt class="docutils literal"><span class="pre">--prefix=&lt;directory&gt;</span></tt></dt>
<dd><p class="first last">Tell your project where it should get installed.</p>
</dd>
</dl>
</li>
</ol>
<p>That&#8217;s it!  Now all you have to do is type <tt class="docutils literal"><span class="pre">gmake</span></tt> (or <tt class="docutils literal"><span class="pre">make</span></tt> if you&#8217;re on a
GNU/Linux system) in the root of your object directory, and your project should
build.</p>
</div>
<div class="section" id="source-tree-layout">
<h2><a class="toc-backref" href="#id3">Source Tree Layout</a><a class="headerlink" href="#source-tree-layout" title="Permalink to this headline">¶</a></h2>
<p>In order to use the LLVM build system, you will want to organize your source
code so that it can benefit from the build system&#8217;s features.  Mainly, you want
your source tree layout to look similar to the LLVM source tree layout.  The
best way to do this is to just copy the project tree from
<tt class="docutils literal"><span class="pre">llvm/projects/sample</span></tt> and modify it to meet your needs, but you can certainly
add to it if you want.</p>
<p>Underneath your top level directory, you should have the following directories:</p>
<p><strong>lib</strong></p>
<blockquote>
<div><p>This subdirectory should contain all of your library source code.  For each
library that you build, you will have one directory in <strong>lib</strong> that will
contain that library&#8217;s source code.</p>
<p>Libraries can be object files, archives, or dynamic libraries.  The <strong>lib</strong>
directory is just a convenient place for libraries as it places them all in
a directory from which they can be linked later.</p>
</div></blockquote>
<p><strong>include</strong></p>
<blockquote>
<div><p>This subdirectory should contain any header files that are global to your
project. By global, we mean that they are used by more than one library or
executable of your project.</p>
<p>By placing your header files in <strong>include</strong>, they will be found
automatically by the LLVM build system.  For example, if you have a file
<strong>include/jazz/note.h</strong>, then your source files can include it simply with
<strong>#include &#8220;jazz/note.h&#8221;</strong>.</p>
</div></blockquote>
<p><strong>tools</strong></p>
<blockquote>
<div>This subdirectory should contain all of your source code for executables.
For each program that you build, you will have one directory in <strong>tools</strong>
that will contain that program&#8217;s source code.</div></blockquote>
<p><strong>test</strong></p>
<blockquote>
<div><p>This subdirectory should contain tests that verify that your code works
correctly.  Automated tests are especially useful.</p>
<p>Currently, the LLVM build system provides basic support for tests. The LLVM
system provides the following:</p>
</div></blockquote>
<ul>
<li><p class="first">LLVM provides a <tt class="docutils literal"><span class="pre">tcl</span></tt> procedure that is used by <tt class="docutils literal"><span class="pre">Dejagnu</span></tt> to run tests.
It can be found in <tt class="docutils literal"><span class="pre">llvm/lib/llvm-dg.exp</span></tt>.  This test procedure uses <tt class="docutils literal"><span class="pre">RUN</span></tt>
lines in the actual test case to determine how to run the test.  See the
<a class="reference external" href="TestingGuide.html">TestingGuide</a> for more details. You can easily write
Makefile support similar to the Makefiles in <tt class="docutils literal"><span class="pre">llvm/test</span></tt> to use <tt class="docutils literal"><span class="pre">Dejagnu</span></tt>
to run your project&#8217;s tests.</p>
</li>
<li><p class="first">LLVM contains an optional package called <tt class="docutils literal"><span class="pre">llvm-test</span></tt>, which provides
benchmarks and programs that are known to compile with the Clang front
end. You can use these programs to test your code, gather statistical
information, and compare it to the current LLVM performance statistics.</p>
<p>Currently, there is no way to hook your tests directly into the <tt class="docutils literal"><span class="pre">llvm/test</span></tt>
testing harness. You will simply need to find a way to use the source
provided within that directory on your own.</p>
</li>
</ul>
<p>Typically, you will want to build your <strong>lib</strong> directory first followed by your
<strong>tools</strong> directory.</p>
</div>
<div class="section" id="writing-llvm-style-makefiles">
<h2><a class="toc-backref" href="#id4">Writing LLVM Style Makefiles</a><a class="headerlink" href="#writing-llvm-style-makefiles" title="Permalink to this headline">¶</a></h2>
<p>The LLVM build system provides a convenient way to build libraries and
executables.  Most of your project Makefiles will only need to define a few
variables.  Below is a list of the variables one can set and what they can
do:</p>
<div class="section" id="required-variables">
<h3><a class="toc-backref" href="#id5">Required Variables</a><a class="headerlink" href="#required-variables" title="Permalink to this headline">¶</a></h3>
<p><tt class="docutils literal"><span class="pre">LEVEL</span></tt></p>
<blockquote>
<div>This variable is the relative path from this <tt class="docutils literal"><span class="pre">Makefile</span></tt> to the top
directory of your project&#8217;s source code.  For example, if your source code
is in <tt class="docutils literal"><span class="pre">/tmp/src</span></tt>, then the <tt class="docutils literal"><span class="pre">Makefile</span></tt> in <tt class="docutils literal"><span class="pre">/tmp/src/jump/high</span></tt>
would set <tt class="docutils literal"><span class="pre">LEVEL</span></tt> to <tt class="docutils literal"><span class="pre">&quot;../..&quot;</span></tt>.</div></blockquote>
</div>
<div class="section" id="variables-for-building-subdirectories">
<h3><a class="toc-backref" href="#id6">Variables for Building Subdirectories</a><a class="headerlink" href="#variables-for-building-subdirectories" title="Permalink to this headline">¶</a></h3>
<p><tt class="docutils literal"><span class="pre">DIRS</span></tt></p>
<blockquote>
<div>This is a space separated list of subdirectories that should be built.  They
will be built, one at a time, in the order specified.</div></blockquote>
<p><tt class="docutils literal"><span class="pre">PARALLEL_DIRS</span></tt></p>
<blockquote>
<div>This is a list of directories that can be built in parallel. These will be
built after the directories in DIRS have been built.</div></blockquote>
<p><tt class="docutils literal"><span class="pre">OPTIONAL_DIRS</span></tt></p>
<blockquote>
<div>This is a list of directories that can be built if they exist, but will not
cause an error if they do not exist.  They are built serially in the order
in which they are listed.</div></blockquote>
</div>
<div class="section" id="variables-for-building-libraries">
<h3><a class="toc-backref" href="#id7">Variables for Building Libraries</a><a class="headerlink" href="#variables-for-building-libraries" title="Permalink to this headline">¶</a></h3>
<p><tt class="docutils literal"><span class="pre">LIBRARYNAME</span></tt></p>
<blockquote>
<div>This variable contains the base name of the library that will be built.  For
example, to build a library named <tt class="docutils literal"><span class="pre">libsample.a</span></tt>, <tt class="docutils literal"><span class="pre">LIBRARYNAME</span></tt> should
be set to <tt class="docutils literal"><span class="pre">sample</span></tt>.</div></blockquote>
<p><tt class="docutils literal"><span class="pre">BUILD_ARCHIVE</span></tt></p>
<blockquote>
<div>By default, a library is a <tt class="docutils literal"><span class="pre">.o</span></tt> file that is linked directly into a
program.  To build an archive (also known as a static library), set the
<tt class="docutils literal"><span class="pre">BUILD_ARCHIVE</span></tt> variable.</div></blockquote>
<p><tt class="docutils literal"><span class="pre">SHARED_LIBRARY</span></tt></p>
<blockquote>
<div>If <tt class="docutils literal"><span class="pre">SHARED_LIBRARY</span></tt> is defined in your Makefile, a shared (or dynamic)
library will be built.</div></blockquote>
</div>
<div class="section" id="variables-for-building-programs">
<h3><a class="toc-backref" href="#id8">Variables for Building Programs</a><a class="headerlink" href="#variables-for-building-programs" title="Permalink to this headline">¶</a></h3>
<p><tt class="docutils literal"><span class="pre">TOOLNAME</span></tt></p>
<blockquote>
<div>This variable contains the name of the program that will be built.  For
example, to build an executable named <tt class="docutils literal"><span class="pre">sample</span></tt>, <tt class="docutils literal"><span class="pre">TOOLNAME</span></tt> should be set
to <tt class="docutils literal"><span class="pre">sample</span></tt>.</div></blockquote>
<p><tt class="docutils literal"><span class="pre">USEDLIBS</span></tt></p>
<blockquote>
<div><p>This variable holds a space separated list of libraries that should be
linked into the program.  These libraries must be libraries that come from
your <strong>lib</strong> directory.  The libraries must be specified without their
<tt class="docutils literal"><span class="pre">lib</span></tt> prefix.  For example, to link <tt class="docutils literal"><span class="pre">libsample.a</span></tt>, you would set
<tt class="docutils literal"><span class="pre">USEDLIBS</span></tt> to <tt class="docutils literal"><span class="pre">sample.a</span></tt>.</p>
<p>Note that this works only for statically linked libraries.</p>
</div></blockquote>
<p><tt class="docutils literal"><span class="pre">LLVMLIBS</span></tt></p>
<blockquote>
<div><p>This variable holds a space separated list of libraries that should be
linked into the program.  These libraries must be LLVM libraries.  The
libraries must be specified without their <tt class="docutils literal"><span class="pre">lib</span></tt> prefix.  For example, to
link with a driver that performs an IR transformation you might set
<tt class="docutils literal"><span class="pre">LLVMLIBS</span></tt> to this minimal set of libraries <tt class="docutils literal"><span class="pre">LLVMSupport.a</span> <span class="pre">LLVMCore.a</span>
<span class="pre">LLVMBitReader.a</span> <span class="pre">LLVMAsmParser.a</span> <span class="pre">LLVMAnalysis.a</span> <span class="pre">LLVMTransformUtils.a</span>
<span class="pre">LLVMScalarOpts.a</span> <span class="pre">LLVMTarget.a</span></tt>.</p>
<p>Note that this works only for statically linked libraries. LLVM is split
into a large number of static libraries, and the list of libraries you
require may be much longer than the list above. To see a full list of
libraries use: <tt class="docutils literal"><span class="pre">llvm-config</span> <span class="pre">--libs</span> <span class="pre">all</span></tt>.  Using <tt class="docutils literal"><span class="pre">LINK_COMPONENTS</span></tt> as
described below, obviates the need to set <tt class="docutils literal"><span class="pre">LLVMLIBS</span></tt>.</p>
</div></blockquote>
<p><tt class="docutils literal"><span class="pre">LINK_COMPONENTS</span></tt></p>
<blockquote>
<div>This variable holds a space separated list of components that the LLVM
<tt class="docutils literal"><span class="pre">Makefiles</span></tt> pass to the <tt class="docutils literal"><span class="pre">llvm-config</span></tt> tool to generate a link line for
the program. For example, to link with all LLVM libraries use
<tt class="docutils literal"><span class="pre">LINK_COMPONENTS</span> <span class="pre">=</span> <span class="pre">all</span></tt>.</div></blockquote>
<p><tt class="docutils literal"><span class="pre">LIBS</span></tt></p>
<blockquote>
<div><p>To link dynamic libraries, add <tt class="docutils literal"><span class="pre">-l&lt;library</span> <span class="pre">base</span> <span class="pre">name&gt;</span></tt> to the <tt class="docutils literal"><span class="pre">LIBS</span></tt>
variable.  The LLVM build system will look in the same places for dynamic
libraries as it does for static libraries.</p>
<p>For example, to link <tt class="docutils literal"><span class="pre">libsample.so</span></tt>, you would have the following line in
your <tt class="docutils literal"><span class="pre">Makefile</span></tt>:</p>
<blockquote>
<div><div class="highlight-makefile"><div class="highlight"><pre><span class="nv">LIBS</span> <span class="o">+=</span> -lsample
</pre></div>
</div>
</div></blockquote>
</div></blockquote>
<p>Note that <tt class="docutils literal"><span class="pre">LIBS</span></tt> must occur in the Makefile after the inclusion of
<tt class="docutils literal"><span class="pre">Makefile.common</span></tt>.</p>
</div>
<div class="section" id="miscellaneous-variables">
<h3><a class="toc-backref" href="#id9">Miscellaneous Variables</a><a class="headerlink" href="#miscellaneous-variables" title="Permalink to this headline">¶</a></h3>
<p><tt class="docutils literal"><span class="pre">CFLAGS</span></tt> &amp; <tt class="docutils literal"><span class="pre">CPPFLAGS</span></tt></p>
<blockquote>
<div><p>This variable can be used to add options to the C and C++ compiler,
respectively.  It is typically used to add options that tell the compiler
the location of additional directories to search for header files.</p>
<p>It is highly suggested that you append to <tt class="docutils literal"><span class="pre">CFLAGS</span></tt> and <tt class="docutils literal"><span class="pre">CPPFLAGS</span></tt> as
opposed to overwriting them.  The master <tt class="docutils literal"><span class="pre">Makefiles</span></tt> may already have
useful options in them that you may not want to overwrite.</p>
</div></blockquote>
</div>
</div>
<div class="section" id="placement-of-object-code">
<h2><a class="toc-backref" href="#id10">Placement of Object Code</a><a class="headerlink" href="#placement-of-object-code" title="Permalink to this headline">¶</a></h2>
<p>The final location of built libraries and executables will depend upon whether
you do a <tt class="docutils literal"><span class="pre">Debug</span></tt>, <tt class="docutils literal"><span class="pre">Release</span></tt>, or <tt class="docutils literal"><span class="pre">Profile</span></tt> build.</p>
<p>Libraries</p>
<blockquote>
<div>All libraries (static and dynamic) will be stored in
<tt class="docutils literal"><span class="pre">PROJ_OBJ_ROOT/&lt;type&gt;/lib</span></tt>, where <em>type</em> is <tt class="docutils literal"><span class="pre">Debug</span></tt>, <tt class="docutils literal"><span class="pre">Release</span></tt>, or
<tt class="docutils literal"><span class="pre">Profile</span></tt> for a debug, optimized, or profiled build, respectively.</div></blockquote>
<p>Executables</p>
<blockquote>
<div>All executables will be stored in <tt class="docutils literal"><span class="pre">PROJ_OBJ_ROOT/&lt;type&gt;/bin</span></tt>, where <em>type</em>
is <tt class="docutils literal"><span class="pre">Debug</span></tt>, <tt class="docutils literal"><span class="pre">Release</span></tt>, or <tt class="docutils literal"><span class="pre">Profile</span></tt> for a debug, optimized, or
profiled build, respectively.</div></blockquote>
</div>
<div class="section" id="further-help">
<h2><a class="toc-backref" href="#id11">Further Help</a><a class="headerlink" href="#further-help" title="Permalink to this headline">¶</a></h2>
<p>If you have any questions or need any help creating an LLVM project, the LLVM
team would be more than happy to help.  You can always post your questions to
the <a class="reference external" href="http://lists.cs.uiuc.edu/pipermail/llvmdev/">LLVM Developers Mailing List</a>.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="mailing_lists.html" title="Mailing Lists"
             >next</a> |</li>
        <li class="right" >
          <a href="MakefileGuide.html" title="LLVM Makefile Guide"
             >previous</a> |</li>
  <li><a href="http://llvm.org/">LLVM Home</a>&nbsp;|&nbsp;</li>
  <li><a href="index.html">Documentation</a>&raquo;</li>

          <li><a href="development_process.html" >Development Process Documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2012, LLVM Project.
      Last updated on 2012-12-21.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>